﻿using Roton;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lyon2e
{
    public partial class MainWindow : Form
    {
        public MainWindow()
        {
            // standard initialization
            InitializeComponent();

            // game event handlers
            game.Resize += new EventHandler((object sender, EventArgs e)
                => { ClientSize = game.Size; });

            // initialize size
            this.ClientSize = game.Size;
        }

        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            int left = (ClientSize.Width / 2) - (game.Width / 2);
            int top = (ClientSize.Height / 2) - (game.Height / 2);
            game.Left = left;
            game.Top = top;
        }

        protected override void OnResizeEnd(EventArgs e)
        {
            base.OnResizeEnd(e);
        }
    }
}
